package com.zhny.aiot.dfst.fw.npp.plugin;


import com.zhny.aiot.plugin.ICenterFacilities;
import com.zhny.aiot.plugin.IDevice;
import com.zhny.aiot.plugin.core.plugin.AbstractFactory;
import com.zhny.aiot.plugin.model.DeviceEntity;
import com.zhny.aiot.plugin.model.FactoryType;
import com.zhny.aiot.plugin.model.StoreEntity;
import org.pf4j.Extension;
import org.pf4j.Plugin;
import org.pf4j.PluginWrapper;

public class NppPlugin extends Plugin {
    public NppPlugin(PluginWrapper wrapper) {
        super (wrapper);
    }
    @Extension
    public static class NppFactory extends AbstractFactory<NppConfig> {

        @Override
        public Class configClass() {
            return NppConfig.class;
        }

        public IDevice createDevice(ICenterFacilities iCenterFacilities, DeviceEntity entity) {
            return new NppDevice(this, iCenterFacilities, entity);
        }

        public Class<? extends StoreEntity> storeClass() {
            return NppStore.class;
        }

        public String getId() {
            return "fw-npp-plugin";
        }

        public String getName() {
            return "方物氮磷钾传感器插件";
        }

        public FactoryType getType() {
            return FactoryType.NitrogenPhosphorusPotassium;
        }
    }
}
